package cn.openea.perpartner.meily.web.controller;

import cn.openea.perpartner.common.core.web.domain.AjaxResult;
import cn.openea.perpartner.meily.web.entity.dto.MaterialDownloadDTO;
import cn.openea.perpartner.meily.web.service.IProvideSamplesService;
import cn.openea.perpartner.meily.web.service.ITrialEvaluationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ysk
 * @version 1.0.1
 * @Description 线下下载素材
 * @createTime 2023年05月29日 13:48:00
 */
@Api(tags = "本地下载素材")
@RestController
@RequestMapping("/material/download")
public class MaterialDownloadController {

    @Resource
    private IProvideSamplesService provideSamplesService;
    @Resource
    private ITrialEvaluationService trialEvaluationService;

    @ApiOperation("样品素材下载")
    @PostMapping("/samples/{code}")
    public AjaxResult provideSamplesMaterial(@PathVariable String code){
        MaterialDownloadDTO materialDownloadDTO = provideSamplesService.getMaterialDirectory(code);
        return AjaxResult.success(materialDownloadDTO);
    }


    @ApiOperation("测评素材下载")
    @PostMapping("/trialEvaluation/{code}")
    public AjaxResult trialEvaluationMaterial(@PathVariable String code){
        MaterialDownloadDTO materialDownloadDTO = trialEvaluationService.getMaterialDirectory(code);
        return AjaxResult.success(materialDownloadDTO);
    }

}


